
<!--- Variables required to initialize the dbCFC --->
<cfset dataSource 		= "myAppMsSQL" />				<!--- Datasource name --->
<cfset metaDataSource 	= "myAppMsSQL" />				<!--- Datasource name --->

<cfset tableSchema 		= "myAppSQL" />					<!--- Database name. we always use dbo users --->
<cfset dbEngine 		= 2 />							<!--- 1=MS Access, 2=MS SQL, 3=Oracle, 4=My SQL --->
<cfset dbType 			= "MsSQL" />
<cfset dbVersion 		= "2005" />
<cfset dbConcatStr 		= " + " />								<!--- || = Oracle, + = MS SQL, & = Ms Access --->
<cfset dbDate 			= " toChar( sysDate, 101 ) " />				<!---  1=date(), 2= toChar( sysDate, 101 ),3= to_date(sysdate), 4= current_date() --->
<cfset dbTime 			= " getDate() " />
<cfset dbDateTime 		= " getDate() " />						<!---  1=now(),2= getDate(),3= sysdate, 4= current_datetime() --->


<!--- You can use the tools section to create these files... --->
<cfset strMetaExceptionFile = "C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\dbcfc\config\dbMetaException.txt" />
<cfset strDBDataTypes = "C:\JRun4\servers\cfusion\cfusion-ear\cfusion-war\dbcfc\config\dbDataTypeException.txt" />

<!--- 
	Load the database bean into memory.
	We call the dbFunctions (generic) as this extends the dbProperties component which is our database bean
 --->

<cfset objDBProperties = CreateObject("component","org.hemtalreja.db.dbFunctions") />
<cfset objDBProperties.setDataSource(datasource) />
<cfset objDBProperties.setMetaDataSource(metaDatasource) />
<cfset objDBProperties.setDBConcatStr(dbConcatStr) />
<cfset objDBProperties.setDBEngine(dbEngine) />
<cfset objDBProperties.setDBType(dbType) />
<cfset objDBProperties.setDBVersion(dbVersion) />
<cfset objDBProperties.setDBDate(dbDate) />
<cfset objDBProperties.setDBTime(dbTime) />
<cfset objDBProperties.setDBDateTime(dbDateTime) />
<cfset objDBProperties.setTableSchema(tableSchema) />



<cfset objDBMetaExceptions = CreateObject("component","org.hemtalreja.db.dbMetaExceptions").init(strMetaExceptionFile) />
<cfset objDBDataTypes = CreateObject("component","org.hemtalreja.db.dbDataTypes") />

<cfset objDBMetaRetreiver = CreateObject("component","org.hemtalreja.db.dbMetaRetreiverGeneric").init(objDBMetaExceptions) />
<cfset objMetaLoader = CreateObject("component","org.hemtalreja.db.dbMetaLoader").init(objDBMetaRetreiver, objDBProperties) />

<cfset objDBReader = CreateObject("component","org.hemtalreja.db.dbReader").init(objDBProperties) />
<cfset objDBWriter = CreateObject("component","org.hemtalreja.db.dbWriter").init(objDBProperties, objDBDataTypes) />

<cfset objDB = CreateObject("component","org.hemtalreja.db.dbController").init(objDBProperties, objMetaLoader, objDBReader, objDBWriter) /> 


<!--- Save the objDB to Application Scope, if you are using a framework such as Model-Glue or Mach-II create this as a persistant object... --->

<cflock scope="Application" timeout="2">
	<cfset Application.objDB = objDB />
</cflock>
